/*
 * CAppStateMenu.cpp
 *
 *  Created on: 24/12/2012
 *      Author: Dalton
 */


#include "CAppStateMenu.h"
#include "CAppStateManager.h"
#include <iostream>
using namespace std;

	CAppStateMenu CAppStateMenu::instance;

	CAppStateMenu::CAppStateMenu(){
		surface = NULL;
	}

	void CAppStateMenu::onLButtonDown(int mX, int mY){

		if(mX >= 394 && mX <= 650 && mY >= 280 && mY <= 320 ){
			CAppStateManager::setActiveAppState(APPSTATE_PLAY);
		} else if (mX >= 389 && mX <= 650 && mY >= 356 && mY <= 396 ){
			CAppStateManager::setActiveAppState(APPSTATE_CREATE);
		}
	}

	void CAppStateMenu::onActivate(){
		if((surface = CSurface::onLoad(".//data/imgs/fundo.png")) == NULL){
			return;
		}
	}

	void CAppStateMenu::onDeactivate(){
		SDL_FreeSurface(surface);
		surface = NULL;
	}

	void CAppStateMenu::onRender(SDL_Surface* surfDisplay){
		CSurface::onDraw(surfDisplay, surface, 0, 0);
	}

	CAppStateMenu* CAppStateMenu::getInstance(){
		return &instance;
	}

	void CAppStateMenu::onLoop(){

	}








